//
//  AppDelegate+HYRootController.m
//  TJHYHardwareProduct
//
//  Created by yc on 2017/12/25.
//  Copyright © 2017年 Cong Yao. All rights reserved.
//

#import "AppDelegate+HYRootController.h"
#import "JPushDeleteDeviceToken.h"
#import "HYUserLoginVC.h"
#import "TabBarViewController.h"

@implementation AppDelegate (HYRootController)


- (void)setRootViewController {

    if ([EXRACT_OBJECT(LOGIN) isEqualToString:@"YES"]) {
        TabBarViewController *tabVc = [TabBarViewController new];
        self.window.rootViewController = tabVc;
    } else {
        HYUserLoginVC *vc = [HYUserLoginVC new];
        self.window.rootViewController = vc;
    }
}

- (void)showMainVC {
    
}

- (void)userLogout
{
    JPushDeleteDeviceToken *api = [[JPushDeleteDeviceToken alloc]init];
    [api startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
        NSLog(@"移除推送token成功");
    } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
        
    }];
}

@end
